﻿<UserControl x:Class="_3DView._3DViewControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:My3D="clr-namespace:_3DTools;assembly=3DTools"
             xmlns:tb="clr-namespace:Infragistics.ToyBox;assembly=Infragistics.ToyBox">
    <UserControl.Resources>
        <!-- Objects mesh -->
        <MeshGeometry3D x:Key="ItemMesh" Positions="1.0 1.4 0.0 -1.0 1.4 0.0 -1.0 -1.4 0.0 1.0 -1.4 0.0"
                        Normals="0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 0.0 -1.0" TextureCoordinates="0,0 0,1 1,1 1,0"
                        TriangleIndices="0 1 2 0 2 3" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>

        </Grid.RowDefinitions>
        <My3D:TrackballDecorator Grid.Row="0" x:Name="MyTrackBall">
			<My3D:Interactive3DDecorator x:Name="MyInteractive3DDecorator">
                <Viewport3D x:Name="MyViewPort">
                    <Viewport3D.Camera>
                        <PerspectiveCamera Position="0,1,6" x:Name="MyCamera" LookDirection="0,0,-1" FieldOfView="100" />
                    </Viewport3D.Camera>
                    <My3D:InteractiveVisual3D x:Name="MyInteractiveVisual3D" IsBackVisible="True">
                        <My3D:InteractiveVisual3D.Children>

                        </My3D:InteractiveVisual3D.Children>
                    </My3D:InteractiveVisual3D>
                    <!--<My3D:ScreenSpaceLines3D Color="Red" Points="-10,0,0 10,0,0"/>
                    <My3D:ScreenSpaceLines3D Color="Blue" Points="0,-10,0 0,10,0"/>
                    <My3D:ScreenSpaceLines3D Color="Green" Points="0,0,-10 0,0,10"/>-->
                    <ModelVisual3D>
                        <ModelVisual3D.Children>
                            <ModelVisual3D>
                                <ModelVisual3D.Content>
                                    <DirectionalLight Color="Transparent" Direction="0,0,5"/>
                                </ModelVisual3D.Content>
                            </ModelVisual3D>
                            <ModelVisual3D>
                                <ModelVisual3D.Content>
                                    <DirectionalLight Color="Transparent" Direction="0,0,-5"/>
                                </ModelVisual3D.Content>
                            </ModelVisual3D>
                        </ModelVisual3D.Children>
                    </ModelVisual3D>
                </Viewport3D>
            </My3D:Interactive3DDecorator>

        </My3D:TrackballDecorator>
        <Button Grid.Row="1" x:Name="LeftButton" Click="RightButton_Click"  VerticalAlignment="Top"
                    HorizontalAlignment="Right" Content="&gt;&gt;" DockPanel.Dock="Bottom" Height="25" Width="35"></Button>

        <Button Grid.Row="1" x:Name="FlipButton" Click="FlipButton_Click"  VerticalAlignment="Top"
                    HorizontalAlignment="Center" Content="Flip" DockPanel.Dock="Bottom" Height="25"></Button>

        <Button Grid.Row="1" x:Name="RightButton" Click="LeftButton_Click" Content="&lt;&lt;" VerticalAlignment="Top"
                    HorizontalAlignment="Left" DockPanel.Dock="Bottom"  Height="25" Width="35"></Button>
    </Grid>
</UserControl>
